/**
 * 执行业务逻辑的函数 - 回调函数
 */
const inquirer = require('inquirer')
const { framwork, framworkObj } = require('../../config')
const downloadFun = require('./download')

const myAction = async (project, args) => { // project, args（数组）接收另外的参数
  const answer = await inquirer.prompt([
    {
      type: 'list', // 列表单选
      name: 'framwork', // 接收答案的参数
      choices: framwork, // 选项
      message: '请选择使用的框架'
    }
  ])
  downloadFun(project, framworkObj[answer.framwork])
}

module.exports = myAction